home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 June
/
1986-06.d64
/
autoboot maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
88 lines
100 print"[147]name of program to load":inputpn$
110 input "name of boot program";bn$
120 input "location to jump after load";loc$
130 if loc$="" then basic=1:goto 160
140 if left$(loc$,1)="$" then gosub 760:goto 160
150 loc=val(loc$)
160 input "kill runstop/restore (y/n)";rn$
170 rn$=left$(rn$,1)
180 if not (rn$="y" or rn$="n") then 160
190 open 15,8,15,"i"
200 open 8,8,8,"0:"+bn$+",p,w"
210 print#8,chr$(167)chr$(02);
220 print#8,chr$(len(pn$));
230 print#8,pn$;
240 if rn$="n" then 380
250 for c=1 to 17
260 read code
270 print#8,chr$(code);
280 next c
290 data 120 : rem sei
300 data 169,052 : rem lda #52
310 data 141,020,003 : rem sta $0314
320 data 169,134 : rem lda #134
330 data 141,024,003 : rem sta $0318
340 data 169,234 : rem lda #234
350 data 141,025,003 : rem sta $0319
360 data 088 : rem cli
370 goto 390
380 for c=1 to 17:read code:next c
390 for c=1 to 38
400 read code
410 print#8,chr$(code);
420 next c
430 data 169,002 :rem lda #2
440 data 162,008 :rem ldx #8
450 data 160,255 :rem ldy #255
460 data 032,186,255 :rem jsr $ffba
470 data 173,167,002 :rem lda $02a7
480 data 162,168 :rem ldx #$a8
490 data 160,002 :rem ldy #$02
500 data 032,189,255 :rem jsr $ffbd
510 data 169,000 :rem lda #$00
520 data 032,213,255 :rem jsr $ffd5
530 data 169,131 :rem lda #131
540 data 141,002,003 :rem sta $0302
550 data 169,164 :rem lda #164
560 data 141,003,003 :rem sta $0303
570 data 134,045 :rem stx $2d
580 data 132,046 :rem sty $2e
590 if basic=1 then gosub 860:goto 620
600 l1=int(loc/256):l2=loc-(l1*256)
610 print#8,chr$(76)chr$(l2)chr$(l1);
620 if rn$="y" then bu=58+len(pn$)+1
630 if rn$="n" then bu=41+len(pn$)+1
640 if basic=1 then bu=bu+11
650 bl=88-bu
660 for c=1 to bl+1:print#8,chr$(0);:next c
670 print#8,chr$(139)chr$(227);
680 b=679+len(pn$)+1
690 l1=int(b/256):l2=b-(l1*256)
700 print#8,chr$(l2)chr$(l1);
710 close8
720 get#15,a$:s=st
730 print a$;
740 if s=0 then 720
750 end
760 l=len(loc$)
770 s=l-1
780 for c=1 to l
790 i$=mid$(loc$,c,1)
800 if i$<="9" then i$=str$(val(i$))
810 if i$=>"a" then i$=str$(asc(i$)-55)
820 loc=loc+val(i$)*16^s
830 s=s-1
840 next c
850 return
860 for c=1 to 14
870 read code
880 print#8,chr$(code);
890 next c
900 data 169,000 :rem lda #$00
910 data 133,122 :rem sta $7a
920 data 169,008 :rem lda #$08
930 data 133,123 :rem sta $78
940 data 032,096,166 :rem jsr $a660
950 data 076,174,167 :rem jmp $a7ae
960 return